package com.huashi.dealer.commonEntity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 购物车商品快照模型类
 * 对应数据库表：yoshop_cart_goods_snapshot
 * 用于记录加入购物车时的商品信息，避免商品信息变更影响购物车
 * 
 * @author 谭陈强
 * @since 2025-01-27
 */
@Data
@TableName("yoshop_cart_goods_snapshot")
@Schema(description = "购物车商品快照实体")
public class CartGoodsSnapshot{

    private static final long serialVersionUID = 1L;

    /**
     * 快照ID
     */
    @TableId(value = "snapshot_id", type = IdType.AUTO)
    @Schema(description = "快照ID")
    private Long snapshotId;

    /**
     * 购物车ID
     */
    @TableField("cart_id")
    @Schema(description = "购物车ID")
    private Long cartId;

    /**
     * 商品ID
     */
    @TableField("goods_id")
    @Schema(description = "商品ID")
    private Long goodsId;

    /**
     * 商品规格ID
     */
    @TableField("goods_sku_id")
    @Schema(description = "商品规格ID")
    private Long goodsSkuId;

    /**
     * 商品名称
     */
    @TableField("goods_name")
    @Schema(description = "商品名称")
    private String goodsName;

    /**
     * 商品图片
     */
    @TableField("goods_image")
    @Schema(description = "商品图片")
    private String goodsImage;

    /**
     * 商品价格
     */
    @TableField("goods_price")
    @Schema(description = "商品价格")
    private BigDecimal goodsPrice;

    /**
     * 商品划线价
     */
    @TableField("line_price")
    @Schema(description = "商品划线价")
    private BigDecimal linePrice;

    /**
     * 商品规格
     */
    @TableField("goods_spec")
    @Schema(description = "商品规格")
    private String goodsSpec;

    /**
     * 库存数量
     */
    @TableField("stock_num")
    @Schema(description = "库存数量")
    private Integer stockNum;

    /**
     * 商品分类ID
     */
    @TableField("category_id")
    @Schema(description = "商品分类ID")
    private Long categoryId;

    /**
     * 商品卖点
     */
    @TableField("selling_point")
    @Schema(description = "商品卖点")
    private String sellingPoint;

    /**
     * 条形码
     */
    @TableField("bar_code")
    @Schema(description = "条形码")
    private String barCode;

    /**
     * 商品规格类型：10单规格，20多规格
     */
    @TableField("spec_type")
    @Schema(description = "商品规格类型：10单规格，20多规格")
    private Integer specType;

    /**
     * 库存计算方式：10下单减库存，20付款减库存
     */
    @TableField("deduct_stock_type")
    @Schema(description = "库存计算方式：10下单减库存，20付款减库存")
    private Integer deductStockType;

    /**
     * 商品状态：10上架，20下架
     */
    @TableField("goods_status")
    @Schema(description = "商品状态：10上架，20下架")
    private Integer goodsStatus;

    /**
     * 创建时间
     */
    @TableField("create_time")
    @Schema(description = "创建时间")
    private Long createTime;
}
